package com.alks.function.data.request.chengKong;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Objects;

@Getter
@Setter
@NoArgsConstructor
public class YfMtlTypeDetailRequest {

    @ApiModelProperty(value = "大类代码",name = "typeNo")
    private String typeNo;

    @ApiModelProperty(value = "大类名称",name = "typeName")
    private String typeName;

    @ApiModelProperty(value = "中类代码",name = "typeNo2")
    private String typeNo2;

    @ApiModelProperty(value = "中类名称",name = "typeName2")
    private String typeName2;

    @ApiModelProperty(value = "小类代码",name = "typeNo3")
    private String typeNo3;

    @ApiModelProperty(value = "小类名称",name = "typeName3")
    private String typeName3;

    @ApiModelProperty(value = "材料属性",name = "mtlProperty")
    private String mtlProperty;

    @ApiModelProperty(value = "是否必选 Y是 √",name = "propertyNeed")
    private String propertyNeed;

    @ApiModelProperty(value = "名称组成顺序",name = "propertySeq")
    private BigDecimal propertySeq;

    @ApiModelProperty(value = "是否编码 Y是 √",name = "mtlNoNeed")
    private String mtlNoNeed;

    @ApiModelProperty(value = "材料属性序号",name = "seqNo")
    private BigDecimal seqNo;

    public boolean isEquals(YfMtlTypeDetailRequest other) {
        // 如果是同一个对象，直接返回 true
        if (this == other) return true;

        // 如果对象为 null，返回 false
        if (other == null) return false;

        // 如果对象的类别不同，返回 false
        if (getClass() != other.getClass()) return false;

        // 逐个比较属性值
        if (!Objects.equals(typeNo, other.typeNo)) return false;
        if (!Objects.equals(typeName, other.typeName)) return false;
        if (!Objects.equals(typeNo2, other.typeNo2)) return false;
        if (!Objects.equals(typeName2, other.typeName2)) return false;
        if (!Objects.equals(typeNo3, other.typeNo3)) return false;
        if (!Objects.equals(typeName3, other.typeName3)) return false;
        if (!Objects.equals(mtlProperty, other.mtlProperty)) return false;
        if (!Objects.equals(propertyNeed, other.propertyNeed)) return false;
        if (!Objects.equals(propertySeq, other.propertySeq)) return false;
        if (!Objects.equals(mtlNoNeed, other.mtlNoNeed)) return false;
        if (!Objects.equals(seqNo, other.seqNo)) return false;

        // 所有属性值相等，返回 true
        return true;
    }

}
